//
//  TKIMGroupChatDelegate.h
//  TKIM
//  聊天室相关协议
//
//  Created by liupm on 15/11/24.
//  Copyright © 2015年 liupm. All rights reserved.
//
@protocol TKIMChatRoomProtocol;
@protocol TKIMGroupProtocol;

@protocol TKIMRoomProtocol <NSObject,TKIMChatRoomProtocol,TKIMGroupProtocol>

@optional

/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新房间置顶状态
 *
 *  @param object
 */
-(void)setRoomIsToTop:(TKIMRoom *)group;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新房间接收推送状态
 *
 *  @param object
 */
-(void)setRoomIsAcceptPush:(TKIMRoom *)group callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-11-25 19:11:43
 *
 *  @brief  清空房间所有消息
 */
-(void)cleanRoomMessage:(TKIMRoom *)room;


/**
 *  @Author lpm, 15-12-25 15:12:08
 *
 *  @brief  查询一个房间
 *
 *  @param rid 房间ID
 *
 *  @return
 */
-(TKIMRoom *)queryAHisRoomById:(NSString *)rid;


/**
 *  @Author lpm, 16-05-10 15:05:28
 *
 *  @brief  查询群组成员信息（默认12个）
 *
 *  @param groupId
 *  @param callBack
 */
-(void)queryGroupMembers:(NSString *)groupId callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-05-27 11:05:43
 *
 *  @brief 分页查询群组成员信息
 *
 *  @param groupId 群ID
 *  @param keyword  关键字
 *  @param pageNo   页号
 *  @param pageSize 第页条数
 *  @param callBack
 */
-(void)queryGroupMembers:(NSString *)groupId  keyword:(NSString *)keyword pageNo:(NSInteger)pageNo pageSize:(NSInteger)pageSize callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-07-12 15:07:48
 *
 *  @brief  设置群禁言状态
 *
 *  @param room
 */
-(void)setRoomGagState:(TKIMRoom *)room callBack:(TKIMCallBack)callBack;;

@end


/**
 *  @Author lpm, 16-01-11 10:01:20
 *
 *  @brief  群组接口
 */
@protocol TKIMGroupProtocol <NSObject>

@optional

/**
 *  @Author lpm, 16-12-29 15:12:01
 *
 *  @brief  建群
 *
 *  @param roomName 群名称
 *  @param nickName 自在在房间中的昵称
 *  @param roomDes  群描述
 *  @param isPublic 是否是公开的
 */
-(void)creatGroup:(NSString *)roomName nickName:(NSString *)nickName  roomDes:(NSString *)roomDes isPublic:(BOOL)isPublic
         callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-12-29 15:12:01
 *
 *  @brief  建群
 *
 *  @param roomName 群名称
 *  @param nickName 自在在房间中的昵称
 *  @param roomDes  群描述
 *  @param isPublic 是否是公开的
 *  @param members 群的初始用户
 */
-(void)creatGroup:(NSString *)roomName nickName:(NSString *)nickName  roomDes:(NSString *)roomDes isPublic:(BOOL)isPublic
          members:(NSMutableArray *)users callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-12-29 15:12:01
 *
 *  @brief  建群
 *
 *  @param roomName 群名称
 *  @param nickName 自在在房间中的昵称
 *  @param roomDes  群描述
 *  @param isPublic 是否是公开的
 *  @param members 群的初始用户
 *  @param avatarUrl 群的初始头像地址
 */
-(void)creatGroup:(NSString *)roomName nickName:(NSString *)nickName  roomDes:(NSString *)roomDes isPublic:(BOOL)isPublic
          members:(NSMutableArray *)users avatarUrl:(NSString *)avatarUrl callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-11-24 18:11:26
 *
 *  @brief  加群组
 *
 *  @param roomName 房间名
 *  @param nickName 本人在房间的昵称
 */
-(void)joinGroup:(TKIMRoom *)group myNickName:(NSString *)nickName callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-12-24 15:12:22
 *
 *  @brief  获得群列表
 */
-(void)getGroupList;


/**
 *  @Author lpm, 16-12-28 11:12:57
 *
 *  @brief  获得群列表
 *
 *  @param callBack 回调
 */
-(void)getGroupList:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-07-12 17:07:24
 *
 *  @brief  获得群组列表
 *
 *  @param callBack
 */
-(void)getGroupListByHttp:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-10-21 14:10:35
 *
 *  @brief  邀请好友
 *
 *  @param useID
 *  @param message
 */
-(void)inviteUser:(NSString *) useID toGroup:(TKIMRoom *)group withMessage:(NSString *)message callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-10-21 17:10:24
 *
 *  @brief  邀请多个好友
 *
 *  @param users
 *  @param message
 */
-(void)inviteUsers:(NSArray *)users toGroup:(TKIMRoom *)group withMessage:(NSString *)message callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-03-16 17:03:02
 *
 *  @brief  拒绝加入群
 *
 *  @param jid
 *  @param inviteMessageStr
 */
- (void)declineGroupInvite:(NSString *)userId JoinTheGroup:(TKIMRoom *)group withMessage:(NSString *)message;


/**
 *  @Author lpm, 16-01-04 18:01:11
 *
 *  @brief  退出群组
 *
 *  @param callBack
 */
-(void)leaveGroup:(TKIMCallBack)callBack NS_DEPRECATED_IOS(4_2, 9_0, "此方法已经被废弃");


/**
 *  @Author lpm, 16-01-04 18:01:11
 *
 *  @brief  退出群组
 *
 *  @param callBack
 */
-(void)leaveGroup:(NSString *)groupId callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-11-25 18:11:38
 *
 *  @brief  查询历史群列表
 */
-(NSMutableArray *)queryHistoryGroupList;


/**
 *  @Author lpm, 15-12-24 16:12:50
 *
 *  @brief  搜索群（分页）
 *
 *  @param keyWord   搜索关键字
 *  @param pageNo    页数
 *  @param pageCount 每页数据
 *  @param callBack  回调
 */
-(void)searchGroupListByKey:(NSString *)keyWord  pageNo:(NSInteger)pageNo pageCount:(NSInteger)pageCount callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-12-24 16:12:38
 *
 *  @brief  查询群的详细信息
 *
 *  @param roomId   群ID
 *  @param callBack 回调
 */
-(void)queryGroupDetailInfo:(NSString *)roomId callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-01-04 10:01:10
 *
 *  @brief  解散当前群
 *
 *  @param callBack 回调
 */
-(void)destroyGroup:(TKIMCallBack)callBack NS_DEPRECATED_IOS(4_2, 9_0, "此方法已经被废弃");;


/**
 *  @Author lpm, 16-01-04 10:01:10
 *
 *  @brief  解散群
 *
 *  @param callBack 回调
 */
-(void)destroyGroup:(NSString *)groupId callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-01-05 10:01:01
 *
 *  @brief  踢人
 *
 *  @param userIds
 */
-(void)banUsers:(NSMutableArray *)userIds callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-01-05 10:01:01
 *
 *  @brief  踢人
 *
 *  @param userIds
 */
-(void)banUsers:(NSMutableArray *)userIds fromRoom:(NSString *)roomId callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-01-11 13:01:56
 *
 *  @brief  修改群名称
 *
 *  @param newName
 *  @param callBack
 */
-(void)modifyGroupName:(NSString *)newName callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-01-11 13:01:56
 *
 *  @brief  修改群信息
 *
 *  @param group
 *  @param callBack
 */
-(void)modifyGroupInfo:(TKIMRoom *)group callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-01-11 13:01:08
 *
 *  @brief  修改群描述
 *
 *  @param description
 *  @param callBack
 */
-(void)modifyGroupDescription:(NSString *)description callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-03-16 17:03:59
 *
 *  @brief  申请加入群
 *
 *  @param groupId     群ID
 *  @param messageStr
 */
-(void)applyJoinTheGroup:(TKIMRoom *)group withMessage:(NSString *)message;


/**
 *  @Author lpm, 16-03-16 18:03:05
 *
 *  @brief  同意好友加入群
 *
 *  @param userId
 *  @param group
 */
-(void)acceptUser:(NSString *)userId JoinTheGroup:(TKIMRoom *)group;


/**
 *  @Author lpm, 16-03-16 18:03:05
 *
 *  @brief  拒绝好友加入群
 *
 *  @param userId
 *  @param group
 */
-(void)declineUser:(NSString *)userId JoinTheGroup:(TKIMRoom *)group withMessage:(NSString *)message;


/**
 *  @Author lpm, 16-09-07 15:09:07
 *
 *  @brief  修改群成员名称
 *
 *  @param groupId  群ID
 *  @param userId   成员ID
 *  @param newName  新名称
 *  @param callBack 回调
 */
-(void)modifyGroupMemberName:(NSString *)groupId userId:(NSString *)userId  newName:(NSString *)newName callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 16-09-14 10:09:59
 *
 *  @brief  添加群成员
 *
 *  @param memebers 成员数组
 *  @param groupId  群组ID
 *  @param callBack 回调
 */
-(void)addGroupMembers:(NSArray <TKIMUser *>*)memebers toGroupId:(NSString *)groupId callBack:(TKIMCallBack)callBack;

@end


/**
 *  @Author lpm, 16-01-11 10:01:12
 *
 *  @brief  聊天室接口
 */
@protocol TKIMChatRoomProtocol <NSObject>
@optional

/**
 *  @Author lpm, 15-11-24 18:11:26
 *
 *  @brief  加入房间
 *
 *  @param roomName 房间名
 *  @param nickName 本人在房间的昵称
 */
-(void)joinChatRoom:(TKIMRoom *)room myNickName:(NSString *)nickName callBack:(TKIMCallBack)callBack;


/**
 *  @Author lpm, 15-09-15 16:09:12
 *
 *  @brief  获得聊天室列表
 *
 *  @param sender
 */
-(void)getRoomList;


/**
 *  @Author lpm, 15-12-24 15:12:26
 *
 *  @brief  获得聊天室列表
 *
 *  @param callBack 回调
 */
-(void)getRoomList:(TKIMCallBack)callBack;

/**
 *  @Author lpm, 15-10-21 14:10:07
 *
 *  @brief  离开房间
 */
-(void)leaveRoom;


/**
 *  @Author lpm, 15-11-25 18:11:38
 *
 *  @brief  查询历史房间列表
 */
-(NSMutableArray *)queryHistoryChatRoomList;


@end
